package com.huiyeji.dynamic.core.builder;

import com.huiyeji.dynamic.core.DynamicRegex;
import com.huiyeji.dynamic.core.RegexContainer;
import com.huiyeji.dynamic.core.provider.ParamProvider;
import com.huiyeji.dynamic.core.provider.StatementParamProvider;

import java.util.Collections;

public class StatementParamProviderBuilder implements ParamProviderBuilder {

    public static final String contextParamRegex = DynamicRegex.OBJECT_NAME.simple()+DynamicRegex.DECIMAL_POINT.simple()+DynamicRegex.METHOD.simple();

    @Override
    public ParamProvider build(String paramStr) {
        return new StatementParamProvider(paramStr);
    }

    @Override
    public RegexContainer ruleInitialize() {
        return new RegexContainer(Collections.singletonList(
                StatementParamProviderBuilder.contextParamRegex
        ));
    }

    @Override
    public int getOrder() {
        return 3000;
    }
}
